package org.docmanagement.commons;

import java.util.Comparator;

import org.docmanagement.forms.TodoForm;

/**
 * @author eveno
 *
 */
public class TodoComparator implements Comparator<TodoForm>
{
	/**
	 * 
	 */
	public TodoComparator()
	{
		super();
	}
	/**
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(TodoForm t1, TodoForm t2)
	{
		String text1 = t1.getCategory();
		if (text1 == null)
			text1 = "";
		String text2 = t2.getCategory();
		if (text2 == null)
			text2 = "";
		return text1.compareTo(text2);
	}
}
